import VueRouter from "vue-router";
import Vue from "vue";

Vue.use(VueRouter)

const Home = ()=>import("@/pages/Home")
const Login = ()=>import("@/pages/Login")
const NotFound = ()=>import("@/pages/NotFound")
const News = ()=>import("@/pages/Home/News")
const Game = ()=>import("@/pages/Home/Game")
const Music = ()=>import("@/pages/Home/Music")


const router = new VueRouter({
    mode:"history",
    routes:[
        {
          path:"",
          redirect:"/home"
        },
        {
            path:"/home",
            component:Home,
            name:"Home",
            children:[
                {
                    path:"news",
                    name:"News",
                    component:News
                },
                {
                    path:"music",
                    name:"Music",
                    component:Music
                },
                {
                    path:"game",
                    name:"Game",
                    component:Game
                },
            ]
        },
        {
            path:"/login",
            component:Login,
        },
        {
            path:"/*",
            component:NotFound
        }
    ]
})

export default router